import { getAdminGlApi } from "@/api/adminApi/gl/adminGlApi"
import { setList } from "@/utils/list"
export default {
  state: {
    list: []
  },
  mutations: {
    setlist(state, list) {
      // console.log("mutation.list",list);
      state.list = list
      setList(list)
    },
    // 删
    listdel(state, index) {
      state.list.splice(index, 1)
      setList(state.list)
    },
    // 改
    listedit(state,data){
      
    }
  },
  actions: {
    // list请求渲染
    async listFn({ commit }) {
      let res = await getAdminGlApi()
      // console.log("vuexadmin",res);
      commit("setlist", res)
      return res
    }
  }
}